package hy.config;

import hy.beans.Dog;
import hy.beans.User;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(Dog.class)
@Configuration
public class MyCfg {

    @Bean("user")
    @ConfigurationProperties("user")
    User addUser(){
        User u= new User();
        return u;
    }

}
